<template>
    <div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>序号</td>
                    <td>姓名</td>
                    <td>手机号</td>
                    <td>账号</td>
                    <td>密码</td>
                    <td>所属角色</td>
                    <td>创建人</td>
                </tr>
                <tr v-for="item in list" :key="item.Id">
                    <td>{{ item.Id }}</td>
                    <td>{{ item.Name }}</td>
                    <td>{{ item.Phone.substring(0,3)+"****"+item.Phone.substring(7) }}</td>
                    <td>{{ item.Zhanghao }}</td>
                    <td>{{ "***" }}</td>
                    <td>{{ item.Juese }}</td>
                    <td>{{ item.Create }}</td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive,onMounted} from 'vue'
import axios from 'axios';
import { useRoute,useRouter } from 'vue-router';
import { useStore } from '@/stores/User';
const a=useStore();
const route=useRoute();
const router=useRouter();

let list:any=ref([]);

onMounted(()=>{
    if(a.userInfo)
{
    getlist();
}
else{
    router.push('/login');
}
})

const getlist=()=>{
    axios({
        url:'http://localhost:5130/api/Exams/getAdminList',
        method:'get',
        params:list
    })
    .then(res=>{
        list.value=res.data;
    })
    .catch(err=>{
        console.log(err);
        
    })
}
</script>

<style scoped>

</style>